package com.ch.roomdemo

import androidx.lifecycle.LiveData
import androidx.room.*

@Dao
interface PensionDao {

    @Insert
    fun insertPension(vararg pension: Pension);

    @Delete
    fun deletePension(vararg pension: Pension);

    @Update
    fun updatePension(vararg pension: Pension);

    @Query("SELECT * FROM pension_table")
    fun getAllPension(): LiveData<List<Pension>>;

    @Query("SELECT * FROM pension_table WHERE id= :perSionId")
    fun getPensionById(perSionId: Int): Pension;

    @Query("DELETE FROM pension_table")
    fun deleteAllPension();
}